import * as types from '../constants/ActionTypes';

const initialState = {
  importOVerviewData: '',
  OverviewAnalyData: '',
  OverviewAnalyChannel: '',
  EveryDayData: '',
  importLoading: true,
  startTime: '',
  endTime: '',
};

const ImportOverviewReducer = (state = initialState, action) => {
  switch (action.type) {
    case types.IMPROT_OVERVIEW:
      return ({ ...state,
        ...{
          importLoading: false,
          importOVerviewData: action.importOVerviewData,
        } });
    case types.OVERVIEW_ANALYSIS:
      return ({ ...state,
        ...{
          OverviewAnalyData: action.OverviewAnalyData,
        } });
    case types.OVERVIEW_CHANNEL:
      return ({ ...state,
        ...{
          OverviewAnalyChannel: action.OverviewAnalyChannel,
        } });
    case types.EVERY_DAY:
      return ({ ...state,
        ...{
          EveryDayData: action.EveryDayData,
        } });
    case types.importLoading:
      return ({ ...state,
        ...{
          importLoading: action.importLoading,
        } });
    case types.EVERY_DAY_TIME:
      return ({ ...state,
        ...{
          startTime: action.startTime,
          endTime: action.endTime,
        } });
    default:
      return state;
  }
};

export default ImportOverviewReducer;
